<?php if (!defined('THINK_PATH')) exit();?>
<div style='display:flex;text-align:center'>
	<div style='flex:1'>
		<input type='radio' id='0' index=0 name='info_type' checked  />
		<label for='0'>全部</label>
	</div>
	<div style='flex:1'>
		<input type='radio' id='1' name='info_type'  />
		<label for='1'>出售</label>
	</div>
	<div style='flex:1'>
		<input type='radio' id='2' name='info_type' />
		<label for='2'>出租</label>
	</div>
	<div style='flex:1'>
		<input type='radio' id='3' name='info_type' />
		<label for='3'>求购</label>
	</div>
	<div style='flex:1'>
		<input type='radio' id='4' name='info_type' />
		<label for='4'>求租</label>
	</div>
</div>

<div style='margin:30px auto' id='Me_InfoList'>

</div>

	


<script>
	$(function(){
		//-- 获取信息列表 
		Me_GetInfoList();	


	//缓存的类型下标，自动选择相应的选项与获取数据
		if(sessionStorage.ConditionMe_TypeIndex){
			$('input[name=info_type]').eq(sessionStorage.ConditionMe_TypeIndex).attr('checked','checked');
		}else{
			$('input[name=info_type]').eq(0).attr('checked','checked');
		}


		//类型选项切换事件
		$('input[name=info_type]').change(function(){
			var index = $(this).attr('id');
			sessionStorage.ConditionMe_TypeIndex = index;
			sessionStorage.ConditionMe_Pnow=1;
			//-- 获取信息列表 
			Me_GetInfoList();
		});
	});

	//获取信息列表 
	function Me_GetInfoList(){
		
		var Arr_MeMainInfo = new Array();
		for(var i=0;i<sessionStorage.length;i++){
			var P_MeMainInfo = /conditionme/gi;
			if(P_MeMainInfo.test(sessionStorage.key(i))){
				Arr_MeMainInfo.push(sessionStorage.key(i))
			}else{
				continue;
			}
		}

		Arr_MeMainInfo.sort();

		var Obj_MeMainInfo = new Object();
		for(var i=0;i<Arr_MeMainInfo.length;i++){
			var Str_MeMainInfo = 'Obj_MeMainInfo.'+Arr_MeMainInfo[i]+'=sessionStorage.'+Arr_MeMainInfo[i];
			eval(Str_MeMainInfo);
		}
		var SessStr_MeMainInfo = md5(escape(JSON.stringify(Obj_MeMainInfo)));	//转码的URI
		var Time_MeMainInfo = new Date().getTime();
		var SessGet_MeMainInfo = 'sessionStorage.Page_'+SessStr_MeMainInfo;
		var SessGetTime_MeMainInfo = 'sessionStorage.Time_'+SessStr_MeMainInfo;
		if(eval(SessGet_MeMainInfo) && parseInt(eval(SessGetTime_MeMainInfo))+60000 > Time_MeMainInfo){
		//	$('#Me_InfoList').html(unescape(eval(SessGet_MeMainInfo)));
		}else{
		}
			$.ajax({
				url:'/index.php/Fang/Before/me_main_info_list',
				data:{
					info_type:sessionStorage.ConditionMe_TypeIndex,
					pnow:sessionStorage.ConditionMe_Pnow,
					sess_page_name:SessStr_MeMainInfo

				},
				success:function(res){
					//alert(res);exit;
					$('#Me_InfoList').html(res);
					var SessSet_MeMainInfo = 'sessionStorage.Page_'+SessStr_MeMainInfo+'="'+escape(res)+'"';
					eval(SessSet_MeMainInfo);
					var SessSetTime_MeMainInfo = 'sessionStorage.Time_'+SessStr_MeMainInfo+'='+Time_MeMainInfo;
					eval(SessSetTime_MeMainInfo);
					sess_keep();
				}
			});
	}
</script>